<%-- 
    Document   : index
    Created on : Oct 23, 2012, 8:30:31 PM
    Author     : tiz
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="films" class="manager.FilmsManager"/>
<% films.filmsToXML(getServletContext().getRealPath("/") + "xml\\Films.xml"); %>
<jsp:useBean id="comments" class="manager.CommentsManager"/>
<% comments.commentsToXML(getServletContext().getRealPath("/") + "xml\\Comments.xml"); %>
<jsp:useBean id="rates" class="manager.RateManager"/>
<% rates.ratesToXML(getServletContext().getRealPath("/") + "xml\\Rates.xml");%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Rate for your films </title>
        <link href="css/screenelement.css" rel="stylesheet" type="text/css"/>
    </head>
    <body >
        <div id='cssmenu'>
            <ul>
                <li class='active '><a href='./index.jsp'><span>Home</span></a></li>
                <li><a href='searchFilm.jsp'><span>Search film</span></a></li>
                <c:if test="${empty currentUser}">
                    <li><a href='register.jsp'><span>Register</span></a></li>
                </c:if>
                <li><a href='aboutProject.jsp'><span>About project</span></a></li>
            </ul>
        </div>        
        <div id="login">
            <c:if test="${not empty currentUser}">
                <p align="center" style="color: red;">Welcome ${currentUser} !</p>
            </c:if>
            <c:if test="${empty currentUser}">
                <table>
                    <form action="Controller" method="post">
                        <tr>
                            <td>Username :</td>
                            <td><input type="text" name="txtusername" value="admin" length="50"/></td>
                        </tr>
                        <tr>
                            <td>Password :</td>
                            <td><input type="password" name="txtpassword" value="admin" length="50"/></td>
                        </tr>
                        <tr>
                            <td><input type="submit" value="Login" name="action"/></td>
                        </tr>
                    </form>
                </table>
            </c:if>
        </div>

    </body>
</html>
